<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
		<style>
			[v-cloak]{
				display: none;
			}
			.yellow {
				background: yellow;
			}
			#app div {
				width: 300px;
				height: 300px;
				background: red;
				display: none;
			}
		</style>
		<script src="./src/vue.js"></script>
	</head>

	<body>
		<div id="app">
			<input @keyup.13="addItem" />
			<ul>
				<li v-for="item in arr">{{item}}</li>
			</ul>
		</div>
		<script>
			/*
				v-on 绑定事件
					简写为@
				事件修饰符
					v-on:click.修饰符 = '表达式'

				按键修饰符：
					.enter
					.tab
					.delete (捕获“删除”和“退格”键)
					.esc
					.space
					.up
					.down
					.left
					.right
					.数字（keyCode）

			*/

			new Vue({
				el:'#app',
				data: {
					arr: [1,2,3]
				},
				methods: {
					addItem(ev){
						this.arr.push(ev.target.value)
						ev.target.value = '';
						
					}
				}
			})


		</script>
	</body>
</html>